package br.usp.ime.escola;

import org.nakedobjects.extended.Entity;
import org.nakedobjects.object.AbstractNakedObject;
import org.nakedobjects.object.Title;
import org.nakedobjects.object.value.TextString;

@Entity
public class Matricula extends AbstractNakedObject {
	private static final long serialVersionUID = 1L;

	private final TextString data = new TextString();

	private Aluno aluno;

	private Materia materia;

	public Aluno getAluno() {
		resolve(aluno);
		return aluno;
	}
	public Materia getMateria() {
		resolve(materia);
		return materia;
	}
	public TextString getData() {
		return data;
	}



	public Title title() {
		Title t = getData().title();
		t.append(" ", getMateria());
		t.append(" - ", getAluno());
		return t;
	}

	public void setAluno(Aluno aluno) {
		this.aluno = aluno;
		objectChanged();
	}

	public void setMateria(Materia materia) {
		this.materia = materia;
		objectChanged();
	}
}
